#include <iostream>
using namespace std;
#include <vector>
#include <cstring>
#include <queue>
const int N = 5e5 + 5;
vector<int> e[N], tp;
int Div[N];//存放入度数
queue<int> q;//用于压力入度数为0的点

int n, m;

int topsort_kahn()
{
	//初始，将所有度为0的点压入q中
	for (int i = 1; i <= n; i++)
	{
		if (Div[i] == 0) q.push(i);
	}
	
	while (q.size())
	{
		int x = q.front();
		q.pop();
		tp.push_back(x);//放入tp序列中
		for (auto y : e[x])
		{
			if (--Div[y] == 0) q.push(y);
		}
	}
	
	return tp.size() == n;
}

int main()
{
	cin >> n >> m;
	int x, y;
	//memset(Div, 0, sizeof(Div));
	for (int i = 1; i <= m; i++)
	{
		cin >> x >> y;
		e[x].push_back(y);
		Div[y]++;//记录y的入度数
	}
	
	if (!topsort_kahn()) cout << "-1" << endl;
	else
	{
		for (auto x : tp)	
			cout << x << " ";
	}
	return 0;
}

/*
7 8
2 1
2 7
1 7
3 1
3 5
7 4
7 6
5 6
*/